package com.qf;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.util.Arrays;

//加上这个注解的类，称为引导类
@SpringBootApplication
//springboot 扫描默认的basepackage为引导类所处的package
//可以显示地指定springboot的scan 的basepackage

public class App {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(App.class, args);

        String[] beanDefinitionNames = context.getBeanDefinitionNames();

        //打印spring容器中所有的bena的name
        Arrays.asList(beanDefinitionNames).forEach(System.out::println);
    }
}
